/**
 * @author：anlzou
 * @Date：Created in23:02 2021/4/11
 * @Github：https://github.com/anlzou
 * @Description：
 */
package com.anlzou.springaop;

import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class SleepHelper{
    public SleepHelper(){}

    @Pointcut("execution(* *.sleep())")
    public void sleeppoint(){};

    @Before("sleeppoint()")
    public void beforeSleep(){
        System.out.println("睡觉前要脱衣服！");
    }

    @AfterReturning("sleeppoint()")
    public void afterSleep(){
        System.out.println("起床后要穿衣服！");
    }
}